package com.rao.quartz.controller;

import com.rao.dao.Member;
import com.rao.quartz.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: raoguang
 * @Date: 2022/09/27/2:24
 * @Description:
 */
@RestController
public class TestController {

    @GetMapping("/health")
    public String Health() {
        return "I'm health!!!";
    }

    //只要返回值中存在实体类，他就会被扫描到Swagger中
    @PostMapping("/user")
    public User user() {
        return new User("raoguang", "123");
    }

    //只要返回值中存在实体类，他就会被扫描到Swagger中
    @ApiOperation("member的接口")
    @PostMapping("/member")
    public Member member(@ApiParam("绕大大的名字") String username, String pwd, int age) {
        return new Member(username, "123");
    }
}
